﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MockPrjTeam4
{
    public partial class Login1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //SET DEFAULT VALUES FOR LABELS
            TextUser.Text = "";
            UserNote.Text = "(*)";
            TextPassword.Text = "";
            PasswordNote.Text = "(*)";
        }

        protected void ButtonLogin_Click(object sender, EventArgs e)
        {
            //CHECK TextUser NOT NULL
            if (string.IsNullOrEmpty(TextUser.Text))
            {
                //IF TextUser is NULL
                UserNote.Text = "Require!";
                return;
            }
            //CHECK TextPassword NOT NULL
            if (string.IsNullOrEmpty(TextPassword.Text))
            {
                //CLEAR ALERT FOR TextUser
                UserNote.Text = "";
                PasswordNote.Text = "Require!";
                return;
            }
            //CLEAR ALERT FOR ALL FIELD
            TextUser.Text = "";
            TextPassword.Text = "";
            //Get User by UserName and Password ad Status equal 1 (active)
           
            //CHECK user : DOES EXIST OR Status not equal 1 -> NULL
        }

        protected void ButtonCancel_Click(object sender, EventArgs e)
        {
            //RELOAD PAGE
            Page_Load(sender, e);
        }
    }
}